UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AL3ygLll5LUbfFPW9xjOW5IQVYZJyg9udzf2SEjKc94=' 
WHERE 
  key_id = '64da64675242581055d44cb500457fee6230e8d10a2dcdbd09c4ac60a3e5a589' 
  AND (
    token = 'AL3ygLll5LUbfFPW9xjOW5IQVYZJyg9udzf2SEjKc94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026