UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'inlgoE+WgqUCSZS5ef5I7GJPrqJ+j66E489nUseAErk=' 
WHERE 
  key_id = '2935f1f3d93464ffdaeafd08051611ce8c4ba39c9d63575c480d4832e66e17eb' 
  AND (
    token = 'inlgoE+WgqUCSZS5ef5I7GJPrqJ+j66E489nUseAErk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019