UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YfgadIYDCuB9x5i/asqXAp5pDZlImXmZdpJWVcimgo0='
WHERE
key_id = 'c28edea7fb0554d0a7696cf90896a1d57803fdaf865ab92682d6fd56fe76442c'
AND (
token = 'YfgadIYDCuB9x5i/asqXAp5pDZlImXmZdpJWVcimgo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)