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

Query time 0.00048