UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1EzYO8V5Ic3DNlfJ+ylQzEQiRnJhJleWu4Nx63doJB4=' 
WHERE 
  key_id = '9906d14b920e4f54ef94f46d2d6a7c64dc117e58587c0a853b01e26fc383c34b' 
  AND (
    token = '1EzYO8V5Ic3DNlfJ+ylQzEQiRnJhJleWu4Nx63doJB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018