UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZnnxCXaHXzcx0chO7Oku16anPR6h7fbzuwF/bckNOo0='
WHERE
key_id = 'c1f0f1014fb9e35d56bc3e011b6eb5629d36877fab6a7ebf21e2337f5431fe01'
AND (
token = 'ZnnxCXaHXzcx0chO7Oku16anPR6h7fbzuwF/bckNOo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)