UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M86wI6WKgfclg/SW50bPByyZW68PW/hLBdWsHpF0yCY=' 
WHERE 
  key_id = '3ed5a29ead3af9a3d6ce1ab06853d37edbe0eaa84c2f9a2b8c015dfe40251cd1' 
  AND (
    token = 'M86wI6WKgfclg/SW50bPByyZW68PW/hLBdWsHpF0yCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017