UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gN+bGZiEW2fs85m+Hl2br0WQcr4T2qml4zRxx7GxkwM='
WHERE
key_id = '25060fe9dd2dfbe428e03b4e3920321063846ae92f8ff3b879c41401b40f2087'
AND (
token = 'gN+bGZiEW2fs85m+Hl2br0WQcr4T2qml4zRxx7GxkwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)