UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4pO5Fr/eeMscRjvJhhp14JLg5n4l6avXAzGq1EllRck=' 
WHERE 
  key_id = '4701f7ec399d89d254d1e8a250be440a928ea06874a660a6cfaeaf0cff67c132' 
  AND (
    token = '4pO5Fr/eeMscRjvJhhp14JLg5n4l6avXAzGq1EllRck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027