UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k/hmG638TvoZQ8djAUWrA3A7hp34vKV49bAZI/ASwyE=' 
WHERE 
  key_id = '1d43840866776db901d056ec496623bd50c9f4b02e0eb78e32bc5fb05b578300' 
  AND (
    token = 'k/hmG638TvoZQ8djAUWrA3A7hp34vKV49bAZI/ASwyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031