UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zEGaSX41d4u7JiF/Jg3ql4W7Q8ftDTlBvKPNTJDEXz4=' 
WHERE 
  key_id = '3464de69c2e0447e38572480e414b093d939b04f379ab4c1d8ce068b58277eaa' 
  AND (
    token = 'zEGaSX41d4u7JiF/Jg3ql4W7Q8ftDTlBvKPNTJDEXz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053