UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X4QlGWgZaz/kxknaUc6/L/q7W3lOI2+yVZiQ+YzuTfc=' 
WHERE 
  key_id = 'e88f8b960bd236b5bd10ce62acdb7a53f375d94c097051b05ab7e810e3cb32d0' 
  AND (
    token = 'X4QlGWgZaz/kxknaUc6/L/q7W3lOI2+yVZiQ+YzuTfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017