UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uNEPIhUpu+2VREU8jlqv/5ursyl/tfVlToPXSKfKwYo=' 
WHERE 
  key_id = '1022378f494934c66736e3c8d541138335da56c35db1b3b2fb84ce5102c52125' 
  AND (
    token = 'uNEPIhUpu+2VREU8jlqv/5ursyl/tfVlToPXSKfKwYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043