UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wxHNQ59ed4GA5L1chA3Mu/1aDslx1uYK6rZ7Fi9O7b4='
WHERE
key_id = '5d144bdc115838c874e33290b7cc0e9abc51bfdeea9bc7ea476ef2255de91cb7'
AND (
token = 'wxHNQ59ed4GA5L1chA3Mu/1aDslx1uYK6rZ7Fi9O7b4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)