UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vdHEn8TsLS5wSk6AJxqdqA40C7s+8flvDmbeCP1Zhgw='
WHERE
key_id = '72e0526e3b4d5ca2c0be3588268e87b78bb81f0d78077a463af1aba159a48f6d'
AND (
token = 'vdHEn8TsLS5wSk6AJxqdqA40C7s+8flvDmbeCP1Zhgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)