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