UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RlEz5GbZZDH5n96LxcOKWpJpap7KsQowiWl5Qus9W/8=' 
WHERE 
  key_id = '64e48c890e25c4104f42839f8824015f69328d46a77ad45af20d805a3416d066' 
  AND (
    token = 'RlEz5GbZZDH5n96LxcOKWpJpap7KsQowiWl5Qus9W/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050