UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ffLfscOxZ4IzLi0bFhkf/PCOsKJJm9gCjIxa4cFx6II='
WHERE
key_id = '15ab2e0c52235e5ac42b97225eb8c7de4c43b55fbf66c5ca42dea0e7fbbae7ba'
AND (
token = 'ffLfscOxZ4IzLi0bFhkf/PCOsKJJm9gCjIxa4cFx6II='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)