UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VULRmRjmJbHVeaLeurODG7bZLQUjNGZSe+7I/xSvr3c=' 
WHERE 
  key_id = 'c44a84656b113a42dacd52039d8ea917b9e21ff7338087f090469ef5744412de' 
  AND (
    token = 'VULRmRjmJbHVeaLeurODG7bZLQUjNGZSe+7I/xSvr3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036