UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkwGLnypcl43F3ZX6drslJ7paSOWI2/dAGRWrBOjxtk=' 
WHERE 
  key_id = '724e9b2fdb41f051564738ffded392efc0ef986d0633c607371a01360d6fd3f3' 
  AND (
    token = 'hkwGLnypcl43F3ZX6drslJ7paSOWI2/dAGRWrBOjxtk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035