UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2YRpHcMFwB/0FKb2J3+jAlZ4LvaZIl82JHyJygvNtkg=' 
WHERE 
  key_id = '22dac431ed50adda4e90257ccd10ef5f2254f693755a30886c2aa848ce99628e' 
  AND (
    token = '2YRpHcMFwB/0FKb2J3+jAlZ4LvaZIl82JHyJygvNtkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029