UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZWUBsl13PgXnI/NrmPwcwznZQL0bh8Y/SzZbwTUN9ms=' 
WHERE 
  key_id = '36ee6b1473cfb13d614c2915f95553f333928604b293e67b68566cfa3e416680' 
  AND (
    token = 'ZWUBsl13PgXnI/NrmPwcwznZQL0bh8Y/SzZbwTUN9ms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054