UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ghLSBDx4OT+5H41W1LpLioW7aDs+VUiTOk9r4QYBhqo='
WHERE
key_id = 'e6e04edef62fd0aaa6335163c33e893d6a2ae913958b02e122307774307c1115'
AND (
token = 'ghLSBDx4OT+5H41W1LpLioW7aDs+VUiTOk9r4QYBhqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)