UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zc6THUNuLKiWykRm7nu7wgXsOU6mIRxXKjC4Plgdnhk=' 
WHERE 
  key_id = '8eee01153d9d97ec974d9ebf8ef767a7e6c30a3c896f4033606cb1bb7c0fdf1f' 
  AND (
    token = 'zc6THUNuLKiWykRm7nu7wgXsOU6mIRxXKjC4Plgdnhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037