UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6orI4yyTnWCbwH+dirhPqlWi0MX2KC0BHKHd3Hq4SSA='
WHERE
key_id = 'd8aae5ed9ca87fae857f0fbac4dc90f733526afbef941d65c44478104fb977e5'
AND (
token = '6orI4yyTnWCbwH+dirhPqlWi0MX2KC0BHKHd3Hq4SSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)