UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DbIKGDliFXxH8fGSRex68Fm5YBOUsj0GFc3yDL2J8xM=' 
WHERE 
  key_id = '6bef7f1b049a91cc56c661d5e0a9f5d666783caefed8bb6683785a88cd70eebc' 
  AND (
    token = 'DbIKGDliFXxH8fGSRex68Fm5YBOUsj0GFc3yDL2J8xM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024