UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HM+KTcmEPgf2lNBBSiC4Pq2tD09KZSRZdF63RZmOV9w=' 
WHERE 
  key_id = '2286c9542d8e4b495a64ab067230f0d2dda64a1e3a6a35566e5e50d752304f5c' 
  AND (
    token = 'HM+KTcmEPgf2lNBBSiC4Pq2tD09KZSRZdF63RZmOV9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035