UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2nHQ0Bi2ZXoaVsTDnIzwRc8TZNZQqim0wqj7FsbpD94='
WHERE
key_id = '721982416db1a6b3e2411263350280a578ed583df487dc021e6b51b39bfc124c'
AND (
token = '2nHQ0Bi2ZXoaVsTDnIzwRc8TZNZQqim0wqj7FsbpD94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)