UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0zz21ZfPwfa4KGcoYiJxyIr1BDz4tCtpf9lZh0N9RAc='
WHERE
key_id = 'd002a8d06e07891057d9fc3f8507e0efb3b73f770cff2ca1a59753c38400ba75'
AND (
token = '0zz21ZfPwfa4KGcoYiJxyIr1BDz4tCtpf9lZh0N9RAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)