UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWBN6gBzz4Zesbf5ZoUMy02S4FKFPZYISyI9K+dUTO8=' 
WHERE 
  key_id = '1964550926c7e4696584d8e5e3e76067e2ec61bbe6df6ee0c9966d4ce1ac7c69' 
  AND (
    token = 'mWBN6gBzz4Zesbf5ZoUMy02S4FKFPZYISyI9K+dUTO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014