UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlgfqzHPTCF3EU9FVSeiq+U7f6PY0NMzGhcyy2xl8O4=' 
WHERE 
  key_id = '966b42959c40ebd9e4515ff19185bfde5ec8694170406b59e6bb56a010641cba' 
  AND (
    token = 'rlgfqzHPTCF3EU9FVSeiq+U7f6PY0NMzGhcyy2xl8O4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030