UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1944/wDRWro8Q4nriBYTQ5kE+Q2Pus2QlFUx4I7XTPk='
WHERE
key_id = '859f744b30d185768f44e16d34c5b96e4d505f78b3cb69b7093ff33723371865'
AND (
token = '1944/wDRWro8Q4nriBYTQ5kE+Q2Pus2QlFUx4I7XTPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)