UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cxRNgrgSPRe2iRBSQVsaj/wQk35uWLnMQrZqkbUuaSw=' 
WHERE 
  key_id = '499e866d7537754a4893f242b35964abba1d93178fcce25c5a8cf570043913b1' 
  AND (
    token = 'cxRNgrgSPRe2iRBSQVsaj/wQk35uWLnMQrZqkbUuaSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030