UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5VXpNL0W3vxfUaxfAzEL5/IMTz8VmxcqAwn4YB9KKKo=' 
WHERE 
  key_id = '9e29a88360ee94d7a36388224bf4df6073a3612632ed10d59bd5a0af28ccf3f4' 
  AND (
    token = '5VXpNL0W3vxfUaxfAzEL5/IMTz8VmxcqAwn4YB9KKKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034