UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VD3e+s3ojbyZk3pna1WJVpW2HhyZW9BIC3cqGZZXVMs=' 
WHERE 
  key_id = '66f0e258d6e4db1a21b6383c82fe1151624635e97ee844db79fb34dc20a6a5a7' 
  AND (
    token = 'VD3e+s3ojbyZk3pna1WJVpW2HhyZW9BIC3cqGZZXVMs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042