UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rWhvAB2qKdgnD5/Inna4dVPvKT8Cx3m8YQRIE3Cabw8=' 
WHERE 
  key_id = 'cf1133c4595f9906748c9cc0556bb981aecf922b6a680338af79d74ceab87360' 
  AND (
    token = 'rWhvAB2qKdgnD5/Inna4dVPvKT8Cx3m8YQRIE3Cabw8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029