UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vAe/yDVc+AXSfXDg35LjjSc7ut9FQ7DwC/mx1E5LpUI='
WHERE
key_id = '3d710ef6553794ef163b70e7147c31f833192a0fd42344331ab9601d1cc29ffd'
AND (
token = 'vAe/yDVc+AXSfXDg35LjjSc7ut9FQ7DwC/mx1E5LpUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)