UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vAEXjfGe6oS7WO31K9oNjkoGB3laZlCOJ+/s6CPeg8o='
WHERE
key_id = '2d109a7a4599ab1d1129665071c00d1f8f0910fdcdfbe491a4d523cbeba4ba2a'
AND (
token = 'vAEXjfGe6oS7WO31K9oNjkoGB3laZlCOJ+/s6CPeg8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)