UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4nhFLVxDale5zcGaKqt2j+OhQPFIUx0UfSBgC0q1AAk=' 
WHERE 
  key_id = '5ea00a85c9635730dcf138737d8c6ce76ac811c9e096cd37b7f16405436b259c' 
  AND (
    token = '4nhFLVxDale5zcGaKqt2j+OhQPFIUx0UfSBgC0q1AAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022