UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SyAgLZ/SKoqc60FhlByJlx9Z+QzuBuirnKRfJH4p0JA=' 
WHERE 
  key_id = '1d6d4fd6eea842440ef72a74a7e9aee4b8c35baed01fb1929d848a9cff40a4ba' 
  AND (
    token = 'SyAgLZ/SKoqc60FhlByJlx9Z+QzuBuirnKRfJH4p0JA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037