UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YFPb7nkDl333KkIpHucX3F4avdMs2O/rZ1Ww/5cgnZ4=' 
WHERE 
  key_id = '41f6ed4c912620c9c4fbfdacbbd2890faa8fa5c5fa335c99f3a506be787dac9f' 
  AND (
    token = 'YFPb7nkDl333KkIpHucX3F4avdMs2O/rZ1Ww/5cgnZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032