UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uznk0U/M20uY7YdaBtE9e2yswdL0o3eHQVp6JmIoSXU='
WHERE
key_id = '1e1efaf9f10e1ad7cd674fdb52e69d04a4cf35a74e88ca3bb6add0ea55796c7f'
AND (
token = 'Uznk0U/M20uY7YdaBtE9e2yswdL0o3eHQVp6JmIoSXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)