UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qn9B+fY2S8DTrwji+w10aVXcLWH0LC6wzsix0w5ZaRQ=' 
WHERE 
  key_id = '26ee69339d1e28c4f1937cab377f8a8682894483ebbb997061cf37cba81ab9af' 
  AND (
    token = 'Qn9B+fY2S8DTrwji+w10aVXcLWH0LC6wzsix0w5ZaRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049