UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cKONB3GVHenucpvKYqBkJn1ShHSRb3Sg3Cw6DUpcJsE=' 
WHERE 
  key_id = '0745a3ac524f6494853fb93090a8456858bac5404fefa6d34d8b6c4f78dfbf88' 
  AND (
    token = 'cKONB3GVHenucpvKYqBkJn1ShHSRb3Sg3Cw6DUpcJsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045