UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkAoys0qTfraVrcMCk9WMSB1++R/8Zefxw5VphKzrQM='
WHERE
key_id = 'b955339777f03967848909ec22a76f7334f971cfd4cd46f7f1f74f89eafc4d95'
AND (
token = 'NkAoys0qTfraVrcMCk9WMSB1++R/8Zefxw5VphKzrQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)