UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k+jCcs88p3Fbd8dZs2bB+qWkBchvthq41DCXCUqjbcs=' 
WHERE 
  key_id = '4292c65f72f6e552cdddb0b74bb9cf0f1fc0124b47adf0a82246bb2e2402c64f' 
  AND (
    token = 'k+jCcs88p3Fbd8dZs2bB+qWkBchvthq41DCXCUqjbcs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035