UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FofJBTor65M9nJzrYCXYNYPa6BM5Xf6d/z5rFQMNkqI='
WHERE
key_id = 'bf2fb6889ae19ae527970843c28285339aa1b79b2b58fc7aacd86c76de39fc0c'
AND (
token = 'FofJBTor65M9nJzrYCXYNYPa6BM5Xf6d/z5rFQMNkqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)