UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fIFunYA2GnZxrOkDBZ1PllBgZkzW9MUlD9XcEfg1td8='
WHERE
key_id = '60d9c57ff0f93589de4f4919b8514da3e2784319a8b96c46b295e43a323f20bd'
AND (
token = 'fIFunYA2GnZxrOkDBZ1PllBgZkzW9MUlD9XcEfg1td8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)