UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Jrq/tkMHuNve1ztHQ2JboCaui2jWsrGDsKRel0j6NQ=' 
WHERE 
  key_id = '86a80f0df62aab55050cc579841df69c4f7a412ae3e99d0b1385c9ec07aa0419' 
  AND (
    token = '5Jrq/tkMHuNve1ztHQ2JboCaui2jWsrGDsKRel0j6NQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018