UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NruM4M7Pu2TgODnrlVktZpOhzoaU5IA44n1ODQkZTbY='
WHERE
key_id = 'db48b9fd4cbb6c9f54176ec5aaa0a59ef065b430f9652df2fbb7f1d132e670c6'
AND (
token = 'NruM4M7Pu2TgODnrlVktZpOhzoaU5IA44n1ODQkZTbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)