UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzM/EJvDtYob/YGu+hyOABm85TZ2rsQKXMpv6Prfz+Q='
WHERE
key_id = '12b3ef77b8a6dd97cc5a54c61a99b7a8c6db3ca0e80ae9fe24cb4fb11842f0a7'
AND (
token = 'LzM/EJvDtYob/YGu+hyOABm85TZ2rsQKXMpv6Prfz+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)