UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kqNND00OBtp7atbrBcZyhW6/52glHycFb0TaGQZgs4k=' 
WHERE 
  key_id = '22c9b3eb3b95ac0ef6edcd821c870b19f6f2a0f08126aee031367e4f43efcce7' 
  AND (
    token = 'kqNND00OBtp7atbrBcZyhW6/52glHycFb0TaGQZgs4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040