UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ppEr0TUvEZzuNdjZBonls50nq4FYRPgXLxMywGNjwo=' 
WHERE 
  key_id = '3dba33e046afa1185a27d99b7cc58ac535a031574aed9ca7e6740b2c27e0137e' 
  AND (
    token = '1ppEr0TUvEZzuNdjZBonls50nq4FYRPgXLxMywGNjwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040