UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'poD2vDgIQX5jQaHOb8JbApvOl/rQVd8rFl8s54c4KG8=' 
WHERE 
  key_id = '203e6c40399209667723d3ec31acf88f35d8cde1d8f6247675a26fbb40178c6e' 
  AND (
    token = 'poD2vDgIQX5jQaHOb8JbApvOl/rQVd8rFl8s54c4KG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028