UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QmxhQalZfPNKuztm1i+pGs1ZRpchLZXQBIpGMKXomWA=' 
WHERE 
  key_id = '449b2e48beb4cec38543774b8b62edb21b2f8cfb2919d06c21a9261811108fd9' 
  AND (
    token = 'QmxhQalZfPNKuztm1i+pGs1ZRpchLZXQBIpGMKXomWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018