UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kMxrLDS09HcpVYyKbGsrrzwtniUWOK/kF342qEOn9SA='
WHERE
key_id = 'ed20d1508ccf8aadbb6d25ae9fe39b2fb89c19abaf3e1ec2509a7cd9083ef0f5'
AND (
token = 'kMxrLDS09HcpVYyKbGsrrzwtniUWOK/kF342qEOn9SA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)