UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UFjv1MvLg9jO7OWEYAYwP3lglPXMasmNyiYZPiUcG4Q='
WHERE
key_id = '3eda3e737f40c663def98b4b6eb6c85196a6a352a99f751c9510ae5c576eb100'
AND (
token = 'UFjv1MvLg9jO7OWEYAYwP3lglPXMasmNyiYZPiUcG4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)