UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sui+XqDoB7T5KrwTUfE6g0a+J9qcNZt2SmrsSgUjSas='
WHERE
key_id = 'a4da1beb013693918a62526f2d9ab04c155cb04dcceb8c8385bbedbf57944bac'
AND (
token = 'sui+XqDoB7T5KrwTUfE6g0a+J9qcNZt2SmrsSgUjSas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)