UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VQnx0JCqdOb6Y+ZE5gm5xl3wyvg+5Op99lSzfE+QSp8='
WHERE
key_id = '673b123130e13f9ed55b863fb28f0b3a27591f79bfbf1c6eee1321c4d7d98977'
AND (
token = 'VQnx0JCqdOb6Y+ZE5gm5xl3wyvg+5Op99lSzfE+QSp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)