UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9U3bYdhe/3a9vx2jYq3g7FkZhLz9ybQcWSYl7zv2kTY=' 
WHERE 
  key_id = 'c8c64eb2b1e170b5e44532e05128f6921c816e652a6f2884976bdb9ab0d4ccd5' 
  AND (
    token = '9U3bYdhe/3a9vx2jYq3g7FkZhLz9ybQcWSYl7zv2kTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046