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