UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CVgsxrMJ9cRVKzKy34okD8BXkm+SUmdMnu3F1zfA9Nk='
WHERE
key_id = '2c2764ad3cd19ea0b94e9357d3dc9fa5b0868baeb58883b2a731aee2935f61cb'
AND (
token = 'CVgsxrMJ9cRVKzKy34okD8BXkm+SUmdMnu3F1zfA9Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)