UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qs4MUN/UVEHW5gH5jnQxGoS1E+5x5L+b+AaqS0MfbY0=' 
WHERE 
  key_id = 'd81571fc93ca54d1f2edefb9645ac39e364bd27a7e4304451bca050477b30b42' 
  AND (
    token = 'qs4MUN/UVEHW5gH5jnQxGoS1E+5x5L+b+AaqS0MfbY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026