UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vryeZZLOviIikv9Mo/r8vPjoAac0yrTpBhA9e/UiBVw=' 
WHERE 
  key_id = '8d38973ce3371ade5c5aa05ec8c4acb533f162cceda914fa5e47de6d8eded0dc' 
  AND (
    token = 'vryeZZLOviIikv9Mo/r8vPjoAac0yrTpBhA9e/UiBVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026